<template>
  <div>
    <Headers />
    <DigitMap :is-search="isMaxMap" :base-list="baseList" :land-list="landList" @complete="complete" class="container-map"></DigitMap>
    <div @click="isMaxMap = !isMaxMap" class="max-btn">
      <FullscreenExitOutlined v-if="isMaxMap"  />
        <FullscreenOutlined v-else />
      {{ isMaxMap ? '地图恢复' : '地图全屏' }} </div>
    <Transition name="left">
      <div v-if="!isMaxMap" class="left">
        <LeftUp class="left_up" />
        <LeftCenter class="left_center" />
        <LeftDown class="left_down" />
      </div>
    </Transition>
    <Transition name="down">
      <div v-if="!isMaxMap" class="center">
        
        <CenterDown class="center_down" />
      </div>
    </Transition>
      <Transition name="right">
      <div v-if="!isMaxMap" class="right">
        <RightUp class="right_up" />
        <RightCenter class="right_up"></RightCenter>
        <RightDown class="right_down" />
      </div>
      </Transition>
      <Transition name="fade">
    <img v-if="!isMaxMap" src="../../assets/bg2.png" class="bgimg" />
  </Transition>
  </div>
</template>

<script setup>
import { FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons-vue';
import Headers from "../../components/Header.vue";

import LeftUp from "./component/LeftUp.vue";
import LeftCenter from "./component/LeftCenter.vue";
import LeftDown from "./component/LeftDown.vue";
import CenterUp from "./component/CenterUp.vue";
import CenterDown from "./component/CenterDown.vue";
import RightUp from "./component/RightUp.vue";
import RightCenter from "./component/RightCenter.vue";
import RightDown from "./component/RightDown.vue";
import DigitMap from "@/components/Amap/digitMap.vue";
import { getBaseList } from "@/api/baseApi";
import { getLandList } from "@/api/landApi";
import { ref, onMounted } from "vue";
const baseList = ref([])
const landList = ref([])
const isMaxMap = ref(false)

const complete = (e) => {
 

  getBaseList().then(res => {
    baseList.value = res.data
  })
  getLandList().then(res => {
    landList.value = res.data
  })
}

</script>

<style scoped lang="scss">
.content {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.left {
  width: 27%;
  z-index: 10;
  position: relative;
  left: 0;
  float: left;
}

.left_up {
  margin: vh(10) vw(10);
  height: vh(230);
}

.left_center {
  margin: vh(10) vw(10);
  height: vh(230);
}

.left_down {
  margin: vh(10) vw(10);
  height: vh(230);
}

.center {
  width: 46%;
  position: absolute;
  bottom: 0;
  left: 27%;
}

.center_up {
  margin: vh(10) vw(10);
  height: vh(470);
}

.center_down {
  margin: vh(14) vw(10);
  height: vh(230);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.right {
  width: 27%;
  z-index: 10;
  position: relative;
  float: right;
  left: 0;
}

.right_up {
  margin: vh(10) vw(10);
  height: vh(230);
}

.right_down {
  margin: vh(10) vw(10);
  height: vh(230);
}

.container-map {
  position: absolute;
  height: 100%;
  width: 100%;
  padding: 0px;
  margin: 0px;
  box-shadow: 0 0 vw(80) vw(40) rgba(30, 73, 98, 1) inset;
  z-index: 0;
}

.bgimg {
  width: 100%;
  height: 100%;
  z-index: 5;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.max-btn {
  background: #054f63;
  // color: #2cd7bc;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  position: absolute;
  z-index: 10;
  top: 80px;
  left: 27%;
}

.left-enter-active,
.left-leave-active {
  transition: 1s;

}

.left-enter-from,
.left-leave-to {
  left: -100%;
}

.right-enter-active,
.right-leave-active {
  transition: 1s;

}

.right-enter-from,
.right-leave-to {
  left: 100%;
}

.down-enter-active,
.down-leave-active {
  transition: 1s;

}

.down-enter-from,
.down-leave-to {
  bottom: -100%;
}

.fade-enter-active,
.fade-leave-active {
  transition: 1s;

}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>